import React, { Component } from "react";
import styles from "./address.module.scss";
import { connect } from "react-redux";
import { withRouter } from "react-router-dom";

class addAddress extends Component {
  render() {
    return (
      <div>
        <div className={styles.addAddress}>
          <div className={styles.topNavLeft}>
            <svg
              className={styles.icon}
              aria-hidden="true"
              onClick={() => {
                this.props.history.push("/address");
              }}
            >
              <use href="#icon-zuojiantou"></use>
            </svg>
          </div>
          <div className={styles.topNavCenter}>新增地址</div>
        </div>

        <div className={styles.addressForm}>
            <p><label htmlFor="name">姓名</label><input type="text" id="name" placeholder="姓名" /></p>
            <p><label htmlFor="tel">电话</label><input type="text" id="tel" placeholder="Tel" /></p>
            <p><label htmlFor="address">地址</label><input type="text" id="address" placeholder="选择收货地址" /><em onClick={() => {
                this.props.history.push('/map')                
            }
            }>{">"}</em></p>
            <p><label htmlFor="doorNum">门牌号</label><input type="text" id="doorNum" placeholder="例:5号楼203室" /></p>
            <p><label>标签</label><span>家</span><span>公司</span><span>学校</span></p>
        </div>
        <div className={styles.save}>保存</div>
      </div>
    );
  }
}
const mapStateToProps = (state) => {
  return {
    isLogin: state.userReducer.isLogin,
  };
};
export default withRouter(connect(mapStateToProps, null)(addAddress));
